package com.netty.nio;

import java.nio.IntBuffer;
import java.security.SecureRandom;

/**
 * Created by Lxk on 2020/5/10.
 */
public class NioTest {

    public static void main(String[] args) {
        IntBuffer buffer = IntBuffer.allocate(10);
        for(int i = 0; i < buffer.capacity(); i++){
            int randInt = new SecureRandom().nextInt(20);
            buffer.put(randInt);
        }
        buffer.flip();
        while(buffer.hasRemaining()){
            System.out.println(buffer.get());
        }
    }

}
